package org.yonggan.cmcc.util

import org.apache.commons.lang.time.FastDateFormat

/**
  * 计算
  */
object Calculate {


  /**
    *
    * 时间的格式 yyyyMMddHHmissSSS
    */
  val DATE_FORMATE_YMDHMSS = "yyyyMMddHHmmssSSS"

  private val format: FastDateFormat = FastDateFormat.getInstance(DATE_FORMATE_YMDHMSS)

  /**
    * 计算 数值问题
    * 柯里化
    *
    * @param f1
    * @param f2
    * @param f
    * @return
    */
  def compare2Nums(f1: Long, f2: Long)(f: (Long, Long) => Long): Long = f(f1, f2)


  /**
    * 时间字符串转换为Long
    * @return
    */
  def dateStr2Long = (str: String) => DateUtil.getDateTimes(str,DateUtil.DATE_FORMATE_YMDHMSS).getTime


}
